home *** CD-ROM | disk | FTP | other *** search
/ Assassins - Ultimate CD Games Collection 4 / Assassins 4 (1999)(Weird Science).iso / misc / omega / source / mspec.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-02  |  17.7 KB  |  758 lines

  1. /* omega copyright (c) 1987,1988,1989 by Laurence Raphael Brothers */
  2. /* mspec.c */
  3. /* monster special functions */
  4.  
  5. #include "glob.h"
  6.  
  7.  
  8. void m_sp_mp(m)
  9. struct monster *m;
  10. {
  11.   if (m->attacked && (random_range(3) == 1)) {
  12.     mprint("You feel cursed!");
  13.     p_damage(10,UNSTOPPABLE,"a mendicant priest's curse");
  14.     m_vanish(m);
  15.   }
  16.   else if (! m_statusp(m,NEEDY)) {
  17.     mprint("The mendicant priest makes a mystical gesture....");
  18.     mprint("You feel impressed...");
  19.     Player.alignment += 5;
  20.     if (Player.alignment > 20)
  21.       Player.hp = max(Player.hp,Player.maxhp);
  22.     m_vanish(m);
  23.   }
  24. }
  25.  
  26.  
  27.  
  28. void m_sp_ng(m)
  29. struct monster *m;
  30. {
  31.   if (distance(m->x,m->y,Player.x,Player.y) < 2)
  32.     if ((random_range(5) == 1) || (Player.status[VULNERABLE]>0)) {
  33.       mprint("The night gaunt grabs you and carries you off!");
  34.       mprint("Its leathery wings flap and flap, and it giggles insanely.");
  35.       mprint("It tickles you cunningly to render you incapable of escape.");
  36.       mprint("Finally, it deposits you in a strange place.");
  37.       p_teleport(0);
  38.     }
  39. }
  40.  
  41.  
  42.  
  43.  
  44.  
  45. void m_sp_poison_cloud(m)
  46. struct monster *m;
  47. {
  48.   if (distance(m->x,m->y,Player.x,Player.y) < 3) {
  49.     mprint("A cloud of poison gas surrounds you!");
  50.     if (Player.status[BREATHING] > 0)
  51.       mprint("You can breathe freely, however.");
  52.     else p_poison(7);
  53.   }
  54. }
  55.  
  56.  
  57. void m_sp_explode(m)
  58. struct monster *m;
  59. {
  60.   if ((distance(Player.x,Player.y,m->x,m->y)<2) &&
  61.       (m-> hp > 0) && 
  62.       (m->hp < Monsters[m->id].hp))
  63.     fball(m->x,m->y,m->x,m->y,m->hp);
  64. }
  65.  
  66.  
  67.  
  68. void m_sp_demon(m)
  69. struct monster *m;
  70. {
  71.   int mid;
  72.  
  73.   if (random_range(2)) {
  74.     if ((m->id != ML4+6) && /*succubi don't give fear */
  75.     los_p(m->x,m->y,Player.x,Player.y) &&
  76.     (random_range(30) > Player.level+10) &&
  77.     (Player.status[AFRAID] == 0)) {
  78.       mprint("You are stricken with fear!");
  79.       if (! p_immune(FEAR)) Player.status[AFRAID] += m->level;
  80.       else mprint("You master your reptile brain and stand fast.");
  81.     }
  82.     else m_sp_spell(m);
  83.   }
  84.   if ((m->hp < (m->level * 5)) && (m->hp > 1)) {
  85.     mprint("The demon uses its waning lifeforce to summon help!");
  86.     m->hp = 1;
  87.     switch(m->level) {
  88.     case 3: mid = ML2+1; break; /* night gaunt */
  89.     case 4:
  90.     case 5: mid = ML3+2; break; /* lesser frost demon */
  91.     case 6: mid = ML5+4; break; /* frost demon */
  92.     case 7: mid = ML5+12; break; /* outer circle demon */
  93.     case 8: mid = ML6+10; break; /* demon serpent */
  94.     case 9: mid = ML7+14; break; /* inner circle demon */
  95.     }
  96.     summon(-1,mid);
  97.     summon(-1,mid);
  98.   }
  99. }
  100.  
  101.  
  102. void m_sp_acid_cloud(m)
  103. struct monster *m;
  104. {
  105.   if (m_statusp(m,HOSTILE) &&
  106.       (distance(m->x,m->y,Player.x,Player.y) < 3))
  107.     acid_cloud();
  108. }
  109.  
  110.       
  111. void m_sp_escape(m)
  112. struct monster *m;
  113. {
  114.   if (m_statusp(m,HOSTILE))
  115.     m_vanish(m);
  116. }
  117.  
  118.  
  119. void m_sp_ghost(m)
  120. struct monster *m;
  121. {
  122.   if (m_statusp(m,HOSTILE)) {
  123.     mprint("The ghost moans horribly....");
  124.     p_damage(1,FEAR,"a ghost-inspired heart attack");
  125.     mprint("You've been terrorized!");
  126.     if (! p_immune(FEAR)) Player.status[AFRAID] += m->level;
  127.     else mprint("You master your reptile brain and stand fast.");
  128.   }
  129. }
  130.  
  131.  
  132.  
  133.  
  134. /* random spell cast by monster */
  135. void m_sp_spell(m)
  136. struct monster *m;
  137. {
  138.   char action[80];
  139.   if (m_statusp(m,HOSTILE) && los_p(Player.x,Player.y,m->x,m->y)) {
  140.     if (m->uniqueness == COMMON) strcpy(action,"The ");
  141.     else strcpy(action,"");
  142.     strcat(action,m->monstring);
  143.     strcat(action," casts a spell...");
  144.     mprint(action);
  145.     if (! magic_resist(m->level)) switch (random_range(m->level+7)) {
  146.     case 0: 
  147.       nbolt(m->x,m->y,Player.x,Player.y,m->hit,10);
  148.       break;
  149.     case 1:
  150.       mprint("It seems stronger..."); 
  151.       m->hp += random_range(m->level*m->level);
  152.       break;
  153.     case 2:
  154.       haste(-1);
  155.       break;
  156.     case 3:
  157.       cure(-1);
  158.       break;
  159.     case 4:
  160.       lball(m->x,m->y,Player.x,Player.y,20);
  161.       break;
  162.     case 5:
  163.       enchant(-1);
  164.     case 6:
  165.       snowball(m->x,m->y,Player.x,Player.y,30);
  166.       break;
  167.     case 7:
  168.       bless(0-m->level);
  169.       break;
  170.     case 8:
  171.       p_poison(m->level);
  172.       break;
  173.     case 9:
  174.       sleep_player(m->level/2);
  175.       break;
  176.     case 10:
  177.       fbolt(m->x,m->y,Player.x,Player.y,m->hit*3,50);
  178.       break;
  179.     case 11:
  180.       acquire(0-m->level);
  181.       break;
  182.     case 12:
  183.       dispel(-1);
  184.       break;
  185.     case 13:
  186.       disrupt(Player.x,Player.y,50);
  187.       break;
  188.     case 14:
  189.       if (m->uniqueness == COMMON) {
  190.     strcpy(Str2,"a ");
  191.     strcat(Str2,m->monstring);
  192.       }
  193.       else strcpy(Str2,m->monstring);
  194.       level_drain(m->level,Str2);
  195.       break;
  196.     case 15:
  197.     case 16:
  198.       disintegrate(Player.x,Player.y);
  199.       break;
  200.     }
  201.   }
  202. }
  203.  
  204.  
  205.  
  206. /* monsters with this have some way to hide, camouflage, etc until they 
  207.    attack */
  208. void m_sp_surprise(m)
  209. struct monster *m;
  210. {
  211.   if (m->attacked) {
  212.     if (m_statusp(m,HOSTILE) && 
  213.     (! Player.status[TRUESIGHT]) &&
  214.     m_statusp(m,M_INVISIBLE)) {
  215.       m->monchar = Monsters[m->id].monchar;
  216.       if (! Player.status[ALERT]) {
  217.     switch(random_range(4)) {
  218.     case 0: 
  219.       mprint("You are surprised by a sudden treacherous attack!");
  220.       break;
  221.     case 1: 
  222.       mprint("You are shocked out of your reverie by the scream of battle!");
  223.       break;
  224.     case 2: 
  225.       mprint("Suddenly, from out of the shadows, a surprise attack!");
  226.       break;
  227.     case 3: 
  228.       mprint("A shriek of hatred causes you to momentarily freeze up!");
  229.       break;
  230.     }
  231.     morewait();
  232.     setgamestatus(SKIP_PLAYER);
  233.     m_status_reset(m,M_INVISIBLE);
  234.       }
  235.       else {
  236.     mprint("You alertly sense the presence of an attacker!");
  237.     m_status_reset(m,M_INVISIBLE);
  238.       }    
  239.     }
  240.   }
  241. }
  242.  
  243. void m_sp_whistleblower(m)
  244. struct monster *m;
  245. {
  246.   if (m_statusp(m,HOSTILE)) {
  247.     alert_guards();
  248.     m->specialf = M_MELEE_NORMAL;
  249.   }
  250. }
  251.  
  252.  
  253. void m_sp_seductor(m)
  254. struct monster *m;
  255. {
  256.   if (m_statusp(m,HOSTILE)) {
  257.     if (m->uniqueness == COMMON) {
  258.       strcpy(Str2,"The ");
  259.       strcat(Str2,m->monstring);
  260.     }
  261.     else strcpy(Str2,m->monstring);
  262.     strcat(Str2," runs away screaming for help....");
  263.     mprint(Str2);
  264.     m_vanish(m);
  265.     summon(-1,-1);
  266.     summon(-1,-1);
  267.     summon(-1,-1);
  268.   }
  269.   else if (distance(Player.x,Player.y,m->x,m->y) < 2) 
  270.     m_talk_seductor(m);
  271.  
  272. }
  273.  
  274.  
  275. void m_sp_demonlover(m)
  276. struct monster *m;
  277. {
  278.   if (distance(Player.x,Player.y,m->x,m->y) < 2) 
  279.     m_talk_demonlover(m);
  280. }
  281.  
  282. void m_sp_eater(m)
  283. struct monster *m;
  284. {
  285.   int i;
  286.   if (Player.rank[COLLEGE]) m_status_set(m,HOSTILE);
  287.   if (m_statusp(m,HOSTILE))
  288.     if (los_p(m->x,m->y,Player.x,Player.y)) {
  289.       mprint("A strange numbing sensation comes over you...");
  290.       morewait();
  291.       Player.mana = Player.mana / 2;
  292.       if (random_range(4)) enchant(-1);
  293.       else dispel(-1);
  294.       Player.pow--;
  295.       if (--Player.pow < 1) p_death("the Eater of Magic");
  296.     }
  297.   if (m->hp < 10) {
  298.     mprint("The Eater explodes in a burst of mana!");
  299.     manastorm(m->x,m->y,1000);
  300.   }
  301. }
  302.  
  303.  
  304. void m_sp_dragonlord(m)
  305. struct monster *m;
  306. {
  307.   if (m_statusp(m,HOSTILE)) {
  308.     if (distance(m->x,m->y,Player.x,Player.y)<2) {
  309.       if (! Player.status[IMMOBILE]) {
  310.     mprint("A gust of wind from the Dragonlord's wings knocks you down!");
  311.     p_damage(25,NORMAL_DAMAGE,"a gust of wind");
  312.     setgamestatus(SKIP_PLAYER);
  313.     Player.status[IMMOBILE]+=2;
  314.       }
  315.       else if (! Constriction) {
  316.     mprint("The Dragonlord grabs you with his tail!");
  317.     Constriction = 25;
  318.     Player.status[IMMOBILE]+=1;
  319.       }
  320.       else if (random_range(2)) {
  321.     mprint("The coils squeeze tighter and tighter...");
  322.     p_damage(Constriction,NORMAL_DAMAGE,"the Dragonlord");
  323.     Player.status[IMMOBILE]+=1;
  324.     Constriction *=2;
  325.       }
  326.       else {
  327.     mprint("The dragonlord hurls you to the ground!");
  328.     p_damage(2*Constriction,NORMAL_DAMAGE,"the Dragonlord");
  329.     Constriction = 0;
  330.       }
  331.       m_sp_spell(m);
  332.     }
  333.     else {
  334.       Constriction = 0;
  335.       if (view_los_p(m->x,m->y,Player.x,Player.y)) {
  336.     if ((! Player.immunity[FEAR]) && (! Player.status[AFRAID])) {
  337.       mprint("You are awestruck at the sight of the Dragonlord.");
  338.       Player.status[AFRAID]+=5;
  339.     }
  340.     if (random_range(3)) {
  341.       m_sp_spell(m);
  342.       m_sp_spell(m);
  343.     }
  344.       }
  345.     }
  346.   }
  347.   else if (distance(m->x,m->y,Player.x,Player.y)<2)
  348.     mprint("You are extremely impressed at the sight of the Dragonlord.");
  349. }
  350.  
  351.  
  352. void m_sp_blackout(m)
  353. struct monster *m;
  354. {
  355.   if ((distance(m->x,m->y,Player.x,Player.y) < 4) &&
  356.       (Player.status[BLINDED] == 0)) {
  357.     mprint("The fungus emits a burst of black spores. You've been blinded!");
  358.     if (Player.status[TRUESIGHT] > 0) mprint("The blindness quickly passes.");
  359.     else Player.status[BLINDED]+=4;
  360.   }
  361.   if (loc_statusp(m->x,m->y,LIT)) {
  362.     mprint("The fungus chirps.... ");
  363.     mprint("The area is plunged into darkness.");
  364.     torch_check();torch_check();torch_check();
  365.     torch_check();torch_check();torch_check();
  366.     spreadroomdark(m->x,m->y,Level->site[m->x][m->y].roomnumber);
  367.     levelrefresh();
  368.   }
  369. }
  370.  
  371.  
  372. void m_sp_bogthing(m)
  373. struct monster *m;
  374. {
  375.   if (Player.status[IMMOBILE] && 
  376.       (distance(Player.x,Player.y,m->x,m->y) < 2)) {
  377.     if (! Player.status[AFRAID]) {
  378.       mprint("As the bogthing touches you, you feel a frisson of terror....");
  379.       if (Player.immunity[FEAR]) mprint("which you shake off.");
  380.       else Player.status[AFRAID]+=2;
  381.     }
  382.     else {
  383.       mprint("The bogthing's touch causes you scream in agony!");
  384.       p_damage(50,UNSTOPPABLE,"fright");
  385.       mprint("Your struggles grow steadily weaker....");
  386.       Player.con--;
  387.       Player.str--;
  388.       if ((Player.con < 3) || (Player.str < 3))
  389.     p_death("congestive heart failure");
  390.     }
  391.   }
  392. }
  393.  
  394.  
  395. void m_sp_were(m)
  396. struct monster *m;
  397. {
  398.   int mid;
  399.   if (m_statusp(m,HOSTILE) || (Phase == 6)) {
  400.     do mid = random_range(ML9-NML_0)+ML1;
  401.     while ((Monsters[mid].uniqueness != COMMON) ||
  402.        (! m_statusp(&(Monsters[mid]),MOBILE)) ||
  403.        (! m_statusp(&(Monsters[mid]),HOSTILE)));
  404.     m->id = Monsters[mid].id;
  405.     m->hp += Monsters[mid].hp;
  406.     m->status |= Monsters[mid].status;
  407.     m->ac = Monsters[mid].ac;
  408.     m->dmg = Monsters[mid].dmg;
  409.     m->speed = Monsters[mid].speed;
  410.     m->immunity |= Monsters[mid].immunity;
  411.     m->xpv += Monsters[mid].xpv;
  412.     m->corpseweight = Monsters[mid].corpseweight;
  413.     m->monchar = Monsters[mid].monchar;
  414.     m->talkf = Monsters[mid].talkf;
  415.     m->meleef = Monsters[mid].meleef;
  416.     m->strikef = Monsters[mid].strikef;
  417.     m->specialf = Monsters[mid].specialf;
  418.     strcpy(Str1,"were-");
  419.     strcat(Str1,Monsters[mid].monstring);
  420.     strcpy(Str2,"dead were-");
  421.     strcat(Str2,Monsters[mid].monstring);
  422.     m->monstring = salloc(Str1);
  423.     m->corpsestr = salloc(Str2);
  424.     m->immunity += pow2(NORMAL_DAMAGE);
  425.     if (los_p(m->x,m->y,Player.x,Player.y)) 
  426.       mprint("You witness a hideous transformation!");
  427.     else mprint("You hear a distant howl.");
  428.   }
  429. }    
  430.  
  431.  
  432. void m_sp_servant(m)
  433. struct monster *m;
  434. {
  435.   if ((m->id == ML4+12) && (Player.alignment < 0))
  436.     m_status_set(m,HOSTILE);
  437.   else if ((m->id == ML4+13) && (Player.alignment > 0))
  438.     m_status_set(m,HOSTILE);
  439. }
  440.  
  441.  
  442. void m_sp_av(m)
  443. struct monster *m;
  444. {
  445.   if (Player.mana > 0) {
  446.     mprint("You feel a sudden loss of mana!");
  447.     Player.mana -= (max(0,10-distance(m->x,m->y,Player.x,Player.y)));
  448.     dataprint();
  449.   }
  450. }
  451.  
  452. void m_sp_lw(m)
  453. struct monster *m;
  454. {
  455.   if (random_range(2)) {
  456.     if (Level->site[m->x][m->y].locchar == FLOOR) {
  457.       Level->site[m->x][m->y].locchar = LAVA;
  458.       Level->site[m->x][m->y].p_locf = L_LAVA;
  459.       lset(m->x, m->y, CHANGED);
  460.     }
  461.     else if (Level->site[m->x][m->y].locchar == WATER) {
  462.       Level->site[m->x][m->y].locchar = FLOOR;
  463.       Level->site[m->x][m->y].p_locf = L_NO_OP;
  464.       lset(m->x, m->y, CHANGED);
  465.     }
  466.   }
  467. }
  468.  
  469.  
  470. void m_sp_angel(m)
  471. struct monster *m;
  472. {
  473.   int mid,hostile = FALSE;
  474.   switch(m->aux1) {
  475.   case ATHENA:
  476.   case ODIN: 
  477.     hostile = ((Player.patron == HECATE) || (Player.patron == SET));
  478.     break;
  479.   case SET:
  480.   case HECATE: 
  481.     hostile = ((Player.patron == ODIN) || (Player.patron == ATHENA));
  482.     break;
  483.   case DESTINY:
  484.     hostile = (Player.patron != DESTINY);
  485.     break;
  486.   }
  487.   if (hostile)
  488.     m_status_set(m,HOSTILE);
  489.   if (m_statusp(m,HOSTILE)) {
  490.     mprint("The angel summons a heavenly host!");
  491.     switch(m->level) {
  492.     case 9: mid = ML8+11; break; /* high angel */
  493.     case 8: mid = ML6+11; break; /* angel */
  494.     default:
  495.     case 6: mid = ML3+4; break; /* phantom */
  496.     }
  497.     summon(-1,mid);
  498.     summon(-1,mid);
  499.     summon(-1,mid);
  500.     /* prevent angel from summoning infinitely */
  501.     m->specialf = M_NO_OP;
  502.   }
  503. }
  504.  
  505.  
  506. /* Could completely fill up level */
  507. void m_sp_swarm(m)
  508. struct monster *m;
  509. {
  510.   if (random_range(5)==1) {
  511.     if (view_los_p(m->x,m->y,Player.x,Player.y))
  512.       mprint("The swarm expands!");
  513.     else mprint("You hear an aggravating humming noise.");
  514.     summon(-1,ML4+14);
  515.   }
  516. }
  517.  
  518.  
  519.  
  520.  
  521. /* raise nearby corpses from the dead.... */
  522. void m_sp_raise(m)
  523. struct monster *m;
  524. {
  525.   int x,y;
  526.   pol t;
  527.   for(x=m->x-2;x<=m->x+2;x++)
  528.     for(y=m->y-2;y<=m->y+2;y++)
  529.       if (inbounds(x,y)) 
  530.     if (Level->site[x][y].things != NULL)
  531.       if (Level->site[x][y].things->thing->id == CORPSEID) {
  532.         mprint("The Zombie Overlord makes a mystical gesture...");
  533.         summon(-1,Level->site[x][y].things->thing->charge);
  534.         t = Level->site[x][y].things;
  535.         Level->site[x][y].things = Level->site[x][y].things->next;
  536.         free((char *) t);
  537.       }
  538. }
  539.  
  540.  
  541.  
  542.  
  543. void m_sp_mb(m)
  544. struct monster *m;
  545. {
  546.   if (distance(m->x,m->y,Player.x,Player.y)==1) {
  547.     mprint("The manaburst explodes!");
  548.     if (m_statusp(m,HOSTILE)) {
  549.       mprint("You get blasted!");
  550.       p_damage(random_range(100),UNSTOPPABLE,"a manaburst");
  551.       mprint("You feel cold all over!");
  552.       Player.pow-=3;
  553.       Player.iq--;
  554.       Player.con--;
  555.       Player.str-=2;
  556.       Player.dex--;
  557.       Player.agi--;
  558.       dispel(-1);
  559.     }
  560.     else {
  561.       mprint("You feel toasty warm inside!");
  562.       Player.pow++;
  563.       Player.mana = max(Player.mana,calcmana());
  564.       Player.hp = max(Player.hp,++Player.maxhp);
  565.     }
  566.     m->hp = 0;
  567.   }
  568. }
  569.  
  570.  
  571. void m_sp_mirror(m)
  572. struct monster *m;
  573. {
  574.   int i,x,y;
  575.   if (view_los_p(m->x,m->y,Player.x,Player.y)) {
  576.     if (random_range(20)+6 < m->level) {
  577.       summon(-1,m->id);
  578.       mprint("You hear the sound of a mirror shattering!");
  579.     }
  580.     else for(i=0;i<5;i++) {
  581.       x = m->x + random_range(13)-6;
  582.       y = m->y + random_range(13)-6;
  583.       if (inbounds(x,y)) {
  584.     Level->site[x][y].showchar = m->monchar;
  585.     putspot(x,y,m->monchar);
  586.       }
  587.     }
  588.   }
  589. }
  590.  
  591.  
  592.  
  593. void m_illusion(m)
  594. struct monster *m;
  595. {
  596.   int i = random_range(NUMMONSTERS);
  597.   if (i==NPC || i==HISCORE_NPC) i = m->id; /* can't imitate NPC */
  598.   if (Player.status[TRUESIGHT]) {
  599.     m->monchar = Monsters[m->id].monchar;
  600.     m->monstring = Monsters[m->id].monstring;
  601.   }
  602.   else  if (random_range(5) == 1) {
  603.     m->monchar = Monsters[i].monchar;
  604.     m->monstring = Monsters[i].monstring;
  605.   }
  606. }
  607.  
  608.  
  609.  
  610.  
  611. void m_huge_sounds(m)
  612. struct monster *m;
  613. {
  614.   if (m_statusp(m,AWAKE) &&
  615.       (! los_p(m->x,m->y,Player.x,Player.y)) &&
  616.       (random_range(10) == 1))
  617.     mprint("The dungeon shakes!");
  618. }
  619.  
  620.  
  621.  
  622. void m_thief_f(m)
  623. struct monster *m;
  624. {
  625.   int i = random_item();
  626.   if (random_range(3) == 1) {
  627.     if (distance(Player.x,Player.y,m->x,m->y) < 2) {
  628.       if (p_immune(THEFT) || (Player.level > (m->level*2)+random_range(20))) 
  629.     mprint("You feel secure.");
  630.       else {
  631.     if (i == ABORT)
  632.       mprint("You feel fortunate.");
  633.     else if ((Player.possessions[i]->used) || 
  634.          (Player.dex < m->level*random_range(10))) {
  635.       mprint("You feel a sharp tug.... You hold on!");
  636.     }
  637.     else {
  638.       mprint("You feel uneasy for a moment.");
  639.       if (m->uniqueness == COMMON) {
  640.         strcpy(Str2,"The ");
  641.         strcat(Str2,m->monstring);
  642.       }
  643.       else strcpy(Str2,m->monstring);
  644.       strcat(Str2," suddenly runs away for some reason.");
  645.       mprint(Str2);
  646.       m_teleport(m);
  647.       m->movef = M_MOVE_SCAREDY;
  648.       m->specialf = M_MOVE_SCAREDY;
  649.       m_pickup(m,Player.possessions[i]);
  650.       conform_unused_object(Player.possessions[i]);
  651.       Player.possessions[i] = NULL;
  652.     }
  653.       }
  654.     }
  655.   }
  656. }
  657.  
  658.  
  659. void m_summon(m)
  660. struct monster *m;
  661. {
  662.   if ((distance(Player.x,Player.y,m->x,m->y) < 2) &&
  663.       (random_range(3) == 1)) {
  664.     summon(0,-1);
  665.     summon(0,-1);
  666.       }
  667. }      
  668.  
  669.  
  670. void m_aggravate(m)
  671. struct monster *m;
  672. {
  673.  
  674.   if (m_statusp(m,HOSTILE)) {
  675.     if (m->uniqueness == COMMON) {
  676.       strcpy(Str2,"The ");
  677.       strcat(Str2,m->monstring);
  678.     }
  679.     else strcpy(Str2,m->monstring);
  680.     strcat(Str2," emits an irritating humming sound.");
  681.     mprint(Str2);
  682.     aggravate();
  683.     m_status_reset(m,HOSTILE);
  684.   }
  685. }
  686.  
  687.  
  688.  
  689. void m_sp_merchant(m)
  690. struct monster *m;
  691. {
  692.   pml ml;
  693.   if (m_statusp(m,HOSTILE))
  694.     if (Current_Environment == E_VILLAGE) {
  695.       mprint("The merchant screams: 'Help! Murder! Guards! Help!'");
  696.       mprint("You hear the sound of police whistles and running feet.");
  697.       for (ml=Level->mlist;ml!=NULL;ml=ml->next) {
  698.     m_status_set(ml->m,AWAKE);
  699.     m_status_set(ml->m,HOSTILE);
  700.       }
  701.       m->specialf = M_NO_OP;
  702.     }
  703. }
  704.  
  705. /* The special function of the various people in the court of the archmage */
  706. /* and the sorcerors' circle */
  707. void m_sp_court(m)
  708. struct monster *m;
  709. {
  710.   pml ml;
  711.   if (m_statusp(m,HOSTILE)) {
  712.     mprint("A storm of spells hits you!");
  713.     for(ml=Level->mlist;ml!=NULL;ml=ml->next) {
  714.       m_status_set(ml->m,HOSTILE);
  715.       m_sp_spell(ml->m);
  716.       if (ml->m->specialf == M_SP_COURT)
  717.     ml->m->specialf = M_SP_SPELL;
  718.     }
  719.   }
  720. }
  721.  
  722.  
  723. /* The special function of the dragons in the dragons' lair */
  724. void m_sp_lair(m)
  725. struct monster *m;
  726. {
  727.   pml ml;
  728.   if (m_statusp(m,HOSTILE)) {
  729.     mprint("You notice a number of dragons waking up....");
  730.     mprint("You are struck by a quantity of firebolts.");
  731.     morewait();
  732.     for(ml=Level->mlist;ml!=NULL;ml=ml->next)
  733.       if (ml->m->hp > 0 && ml->m->specialf == M_SP_LAIR) {
  734.     m_status_set(ml->m,HOSTILE);
  735.     fbolt(ml->m->x,ml->m->y,Player.x,Player.y,100,100);
  736.     if (ml->m->id == ML10+3)
  737.       ml->m->specialf = M_SP_DRAGONLORD;
  738.     else
  739.       ml->m->specialf = M_STRIKE_FBOLT;
  740.       }
  741.   }
  742. }
  743.  
  744.  
  745. void m_sp_prime(m)
  746. struct monster *m;
  747. {
  748.   if (m_statusp(m,HOSTILE)) {
  749.     mprint("The prime sorceror gestures and a pentacular gate opens!");
  750.     mprint("You are surrounded by demons!");
  751.     summon(-1,ML9+7);
  752.     summon(-1,ML9+7);
  753.     summon(-1,ML9+7);
  754.     summon(-1,ML9+7);
  755.   }
  756.   m->specialf = M_SP_SPELL;
  757. }
  758.